#include "stdafx.h"
#include "xString.h"

#define theString ((CString*)m_hString)

xString::xString()
{
	m_hString = new CString;
}

xString::~xString()
{
	if(m_hString != NULL)
	{
		delete theString;
	}
}

xString	&xString::operator = (LPCWSTR swStr)
{
	if(m_hString != NULL && swStr != NULL)
	{
		*theString = swStr;
	}
	return *this;
}

LPCWSTR	xString::GetData()
{
	if(m_hString != NULL)
	{
		return (LPCWSTR)*theString;
	}
	return NULL;
}

INT xString::GetLength()
{
	if(m_hString != NULL)
	{
		return theString->GetLength();
	}
	return 0;
}